len() returns the length of a string.
def strlen3(s, t):
length = len(2 * s) + len(3 * t)
return length
Function Call | Return Value | |||
---|---|---|---|---|
strlen3('ant', 'duck') | → | |||
strlen3('', '') | → | |||
strlen3('', '78') | → | |||
strlen3('rock', 'sand') | → | |||
strlen3('ex', 'ball') | → |
Experiment with this code on Gitpod.io